package com.example.spring.bean.load08lifecycle.orderCompare;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;


class Door implements InitializingBean, DisposableBean {


    public Door() {
        System.out.println("Door constructor...");
    }


    /**
     * 指定初始方法
     */
    public void init() {
        System.out.println("Door method init...");
    }

    public void close() {
        System.out.println("Door method close...");
    }


    /**
     * 实现方法
     */
    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("Door impl afterPropertiesSet...");
    }

    @Override
    public void destroy() {
        System.out.println("Door impl destroy...");
    }

    /**
     * jsr250
     */
    @PostConstruct
    public void postConstruct() {
        System.out.println("Door jsr250 postConstruct...");
    }


    @PreDestroy
    public void preDestroy() {
        System.out.println("Door jsr250 preDestroy...");
    }
}
